home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 001 / piblist.arc / READLNF.PAS < prev    next >
Pascal/Delphi Source File  |  1985-03-28  |  3KB  |  54 lines

  1. (*----------------------------------------------------------------------*)
  2. (*                Readln_F:  Read a line from the file F                *)
  3. (*----------------------------------------------------------------------*)
  4.  
  5. PROCEDURE Readln_F;
  6.  
  7. (*----------------------------------------------------------------------*)
  8. (*                                                                      *)
  9. (*   Procedure:   Readln_F                                              *)
  10. (*                                                                      *)
  11. (*   Purpose:     Read a line from the file F                           *)
  12. (*                                                                      *)
  13. (*   Calling sequence:                                                  *)
  14. (*                                                                      *)
  15. (*      Readln_F;                                                       *)
  16. (*                                                                      *)
  17. (*   Calls:  RMAX                                                       *)
  18. (*                                                                      *)
  19. (*   Remarks:                                                           *)
  20. (*                                                                      *)
  21. (*      EOF( F ) MUST be FALSE on entry, but may be TRUE on exit.       *)
  22. (*      Cur_Line, Cur_Page, Max_Line, and Max_Page are updated.         *)
  23. (*                                                                      *)
  24. (*      Note:  The input buffer for file F is used to "peek" at         *)
  25. (*             the next character.  This corresponds to looking at      *)
  26. (*             F^ in standard Pascal.                                   *)
  27. (*                                                                      *)
  28. (*----------------------------------------------------------------------*)
  29.  
  30. VAR
  31.    Buf_Ptr: Buffer_Ptr;
  32.  
  33. BEGIN (* Readln_F *)
  34.                                    (* Reset F to beginning of next  *)
  35.                                    (* line.                         *)
  36.    IF ( NOT Strip_High ) THEN Readln( F );
  37.                                    (* Update current line           *)
  38.    Cur_line := Cur_line + 1;
  39.    Max_line := RMAX( Cur_line , Max_line );
  40.  
  41.                                    (* See if next char will be page *)
  42.                                    (* marker.  If so, update page   *)
  43.                                    (* count now.                    *)
  44.  
  45.    Buf_Ptr := PTR( SEG( F_Ptr^ ) , F_Ptr^.BufPtr );
  46.  
  47.    IF Buf_Ptr^[0] = Eject_Char THEN
  48.       BEGIN
  49.          Cur_page := Cur_page + 1;
  50.          Max_page := RMAX( Cur_page , Max_page );
  51.       END;
  52.  
  53. END   (* Readln_F *);
  54.